package com.uetoken.cn.getui;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;

import com.blankj.utilcode.util.LogUtils;
import com.igexin.sdk.GTServiceManager;

/**
 * @author 谢杨
 * @date 2018年8月7日10:44:25
 * 为了让推送服务在部分主流机型上更稳定运行，从2.9.5.0版本开始，个推支持第三方应用配置使用自定义Service来作为推送服务运行的载体。
 */
public class GeTuiPushService extends Service {
    String TAG = "GeTuiPushService==";

    @Override
    public void onCreate() {
        super.onCreate();
        LogUtils.dTag(TAG, TAG + " -->onCreate");
        GTServiceManager.getInstance().onCreate(this);
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        super.onStartCommand(intent, flags, startId);
        LogUtils.dTag(TAG, TAG + " -->onStartCommand");
        return GTServiceManager.getInstance().onStartCommand(this, intent, flags, startId);
    }

    @Override
    public IBinder onBind(Intent intent) {
        LogUtils.dTag(TAG, TAG + " -->onBind");
        return GTServiceManager.getInstance().onBind(intent);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        LogUtils.dTag(TAG, TAG + " -->onDestroy");
        GTServiceManager.getInstance().onDestroy();
    }

    @Override
    public void onLowMemory() {
        super.onLowMemory();
        LogUtils.dTag(TAG, TAG + " -->onLowMemory");
        GTServiceManager.getInstance().onLowMemory();
    }
}
